<?php
//和ajax_page.html配套(删除数据)
$id=$_REQUEST['id'];
if(is_array($id)){
	$id=join(",", $id);
	$del="dels";
}
$pdo=new PDO("mysql:host=127.0.0.1;dbname=news","root","keyan");
$pdo->query("set names utf8");
$sql="delete from newsarticles where articleId in ($id)";
$re = $pdo->query($sql);
//$re = $pdo->exec($sql);
if($re){
	echo 1;
}else{
	echo 0;
}
if($del=="dels"){
	echo "<script>";
	echo "alert('删除成功!');";
	echo "window.location.href='ajax_page.html';";
	echo "</script>";
}